package animation.sort.algorithms;


public class ShellSort
        extends HSort
{
    public String toString()
    {
        return "Shell Sort";
    }

    protected void sort(int array[])
            throws Exception
    {
        // Find the max H posible for this array
        int h = 0;
        for (int i = 1; i < array.length; i = 3 * i + 1) {
            h = i;
        }

        for (; h > 0; h = h / 3) {
            hSort(array, h);
        }
    }

}